<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>修改管理员</title>
		<link rel="stylesheet" href="__PUBLIC__/frame/layui/css/layui.css">
		<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
		<link rel="stylesheet" href="__PUBLIC__/frame/static/css/style.css">
	</head>
	<body>
		<a href="<?php echo U('lst')?>" class="layui-btn" style="margin-top: 10px; "><i class="layui-icon">&#xe603;</i>管理员添加</a>
		<a class="layui-btn btn-add btn-default" id="btn-refresh"style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
          <legend style="font-size: 14px;">添加管理员</legend>
        </fieldset>
		<form class="layui-form layui-form-pane" action="__SELF__" method="post">
			<div class="layui-form-item">
				<input type="hidden" name="pid" lay-verify="title" autocomplete="off" class="layui-input" value="<?php echo $_SESSION['id'];?>">
			    <label class="layui-form-label">用户名</label>
			    <div class="layui-input-block">
			      <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
			    </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">部门</label>
				<div class="layui-input-block">
					<select name="part_id" lay-filter="aihao">
						<option value="">请选择</option>
<?php foreach ($part as $k => $v):?>
						<option value=<?php echo $v['id']?>><?php echo $v['name'];?></option>
<?php endforeach;?>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
			    <label class="layui-form-label">密码</label>
			    <div class="layui-input-block">
			      <input type="text" name="password" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
			    </div>
			</div>
			<div class="layui-form-item">
			    <label class="layui-form-label">确认密码</label>
			    <div class="layui-input-block">
			      <input type="text" name="repassword" lay-verify="pass" placeholder="请确认密码" autocomplete="off" class="layui-input">
			    </div>
			</div>
			<div class="layui-form-item">
			    <label class="layui-form-label">是否启用</label>
			    <div class="layui-input-block">
			      <input type="radio" name="is_use" value="1" title="启用" checked="">
			      <input type="radio" name="is_use" value="0" title="禁用">
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">可选角色</label>
				<div class="layui-input-block">
				<?php foreach ($parr as $k => $v):?>
					<input type="radio" name="role_id[]" value="{$v.id}" title="{$v.role_name}">
				<?php endforeach;?>
				</div>
			</div>
			<!-- <div class="layui-form-item" pane="">
			    <label class="layui-form-label">可选角色</label>
			    <div class="layui-input-block">
<?php foreach ($parr as $k => $v):?>
			      <input type="checkbox" class="aa" name="role_id[]" value="{$v.id}" lay-skin="primary" title="<?php echo $v['role_name']?>">
<?php endforeach;?>			      
			    </div>
			</div> -->
			<div class="layui-form-item">
			    <div class="layui-input-block">
			      <input type="submit" class="layui-btn" lay-submit="" lay-filter="demo1"/>
			      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
			</div>
	    </form>
	</body>
		<script type="text/javascript" src="__PUBLIC__/hawk/js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/hawk/js/public.js"></script>
		<script type="text/javascript" src="__PUBLIC__/frame/layui/layui.js"></script>
	<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  //日期
//laydate.render({
//  elem: '#date'
//});
//laydate.render({
//  elem: '#date1'
//});
  
  //创建一个编辑器
  //var editIndex = layedit.build('LAY_demo_editor');
 
  //自定义验证规则
  // form.verify({
  //   title: function(value){
  //     if(value.length < 5){
  //       return '用户名至少得5个字符啊';
  //     }
  //   }
  //   ,pass: [/(.+){6,12}$/, '密码必须6到12位']
  //   ,content: function(value){
  //     layedit.sync(editIndex);
  //   }
  // });
  
  //监听指定开关
//form.on('switch(switchTest)', function(data){
//  layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
//    offset: '6px'
//  });
//  layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
//});
//
  //监听提交
  // form.on('submit(demo1)', function(data){
  //   layer.alert(JSON.stringify(data.field), {
  //     title: '最终的提交信息'
  //   })
  //   return false;
  // });
  

});
	</script>
</html>
